home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 3.0 KB | 63 lines | [TEXT/GEOL] |
- Item 7399224 8-Sept-90 23:02PDT
-
- From: PEMD CH DEV PEMD Group, Zurich,IDV
-
- To: KNEPPER Knepper, Christopher
-
- cc: MACAPP.TECH$ MacApp Technical
-
- Sub: Where to call focus?
-
- Dear Chris,
-
- I've been carefully considering your link of 5-Sept-90 and attempting to apply
- "always focus before drawing", rather than thinking "where was the focus last
- set". I am also interested in having my code be as consistent with
- object-oreinted principles as possible.
-
- I'm actually not clear on how to implement this. I want to get to the question
- "where to call focus?" and to do that consider a situation where a menu
- command results in some drawing action, but this drawing action does not alter
- the document. Instead, it alters the way the view in the active, front window
- renders the document.
-
- More specifcally, let's say that the document conatins numerical demographic
- data on population, population growth rates, life expectancy, etc. for various
- countries of the world over the last 10 years.. A part of this data (i.e.
- document) is displayed in a view in which a country's population figures are
- shown in a line graph (e.g. population=f(years)) placed in a standard x-y
- coordinate system. A view consists of many such line graphs with a set of axes
- (population on the Y-axis and years on the X-axis).
-
- The user now chooses a menu command "Clear", which erases all graphs from the
- view, but leaves the axes, enabling him to enter a fresh set of countries. Now
- lets go back to the problem in my original set of memos on the "Drawing
- Problem". There are many such views in many such windows on the the screen
- (one view to a window). The window of interest is the front, active window and
- complete screen updating has occured. This window is the first drawn, but the
- last window drawn is the one on which drawing is now focused. The user now
- selects "Clear" from the menu. Where should focus be called? The "Clear"
- command's DoIt method calls Eraserect which without a call to Focus is directed
- at the last window drawn, not the front active window. The DoIt method could
- of course call Focus on its view and such a call would be consistent with
- "always focus before drawing".
-
- Such a strategy would insert Focus calls throughout the code, in this case,
- whenvever the view was changed without a corresponding change to the document.
- This was indeed my initial strategy when I first read your links on my drawing
- problem. I then elected to put a single Focus call at the beginning
- myView.DoMenuCommand, because all such code (except one) that changed the view
- without changing the document was called from myView.DoMenuCommand.
-
- Do you see this as contrary to object-oreinted principles? I do not have any
- particular fidelity to principles as such, and object-oreinted thinking has
- been so useful that I wanted to stay as firmly within the framework as
- possible.
-
- Thanks for time.
-
- Regards,
- Ernie
-
-
-